diff --git a/source_code/.gitignore b/source_code/.gitignore
index 380ca78..d35051d 100644
--- a/source_code/.gitignore
+++ b/source_code/.gitignore
@@ -15,6 +15,7 @@ game_script_native.implib
 game_script_native.lib
 gamescript.dll
 gamescript.dll.lib
+gamescript.lib
 gamescript.exp
 gamescript_library_procedures.dll
 gamescript_library_procedures.exp
diff --git a/source_code/gamescript.h b/source_code/gamescript.h
index bb39b9b..f613ec6 100644
--- a/source_code/gamescript.h
+++ b/source_code/gamescript.h
@@ -31,6 +31,10 @@
 #pragma comment(lib, "lib/windows7-x64/common.lib")
 #pragma comment(lib, "lib/windows7-x64/renderer.lib")
 #pragma comment(lib, "lib/windows7-x64/rtcore.lib")
+#undef File
+#undef Filter
+#include <shlobj.h>  // For SHGetKnownFolderPath
+#include <strsafe.h> // For StringCchCopyW
 #include <windows.h>
 #include "framework/redgpu_f.h"
 #include "framework/cimgui.h"
diff --git a/source_code/gamescript_imgui_custom_input_text_multiline.cpp b/source_code/gamescript_imgui_custom_input_text_multiline.cpp
index 00fc6da..30a2b85 100644
--- a/source_code/gamescript_imgui_custom_input_text_multiline.cpp
+++ b/source_code/gamescript_imgui_custom_input_text_multiline.cpp
@@ -7,6 +7,9 @@ using namespace ImGui;
 // NOTE(Constantine): For overriding key presses in Dear ImGui.
 #include <string>
 extern int g_dearImGuiGoToLine;
+extern int g_dearImGuiGoToCharPosition;
+extern int g_dearImGuiGoToCharPositionSelectionStart;
+extern int g_dearImGuiGoToCharPositionSelectionEnd;
 
 // NOTE(Constantine): using bigger undos for GameScriptImGuiInputTextMultiline only.
 ImStb::StbUndoRecord  ImStb::gGameScriptImGuiStb_undo_rec[STB_TEXTEDIT_UNDOSTATECOUNT] = {};
@@ -526,6 +529,16 @@ bool GameScriptImGuiInputTextEx(void* imgui_context, const char* label, const ch
         }
       }
     }
+    // NOTE(Constantine): Go to char position logic.
+    if (state != NULL && g_dearImGuiGoToCharPosition != -1 && flags & ImGuiInputTextFlags_AllowTabInput) {
+      state->Stb.cursor                         = g_dearImGuiGoToCharPosition;
+      state->Stb.select_start                   = g_dearImGuiGoToCharPositionSelectionStart;
+      state->Stb.select_end                     = g_dearImGuiGoToCharPositionSelectionEnd;
+      g_dearImGuiGoToCharPosition               = -1;
+      g_dearImGuiGoToCharPositionSelectionStart = -1;
+      g_dearImGuiGoToCharPositionSelectionEnd   = -1;
+      state->CursorFollow                       = true;
+    }
 
     // Process other shortcuts/key-presses
     bool cancel_edit = false;
@@ -721,7 +734,7 @@ bool GameScriptImGuiInputTextEx(void* imgui_context, const char* label, const ch
                     memset(&callback_data, 0, sizeof(ImGuiInputTextCallbackData));
                     callback_data.EventFlag = event_flag;
                     callback_data.Flags = flags;
-                    callback_data.UserData = callback_user_data;
+                    callback_data.UserData = (void *)(ImWchar *)state->TextW.Data; // NOTE(Constantine): used to be callback_user_data, but I didn't use that, so passing stb's wide chars state->TextW.Data here directly now.
 
                     callback_data.EventKey = event_key;
                     callback_data.Buf = state->TextA.Data;
@@ -729,11 +742,9 @@ bool GameScriptImGuiInputTextEx(void* imgui_context, const char* label, const ch
                     callback_data.BufSize = state->BufCapacityA;
                     callback_data.BufDirty = false;
 
-                    // We have to convert from wchar-positions to UTF-8-positions, which can be pretty slow (an incentive to ditch the ImWchar buffer, see https://github.com/nothings/stb/issues/188)
-                    ImWchar* text = state->TextW.Data;
-                    const int utf8_cursor_pos = callback_data.CursorPos = ImTextCountUtf8BytesFromStr(text, text + state->Stb.cursor);
-                    const int utf8_selection_start = callback_data.SelectionStart = ImTextCountUtf8BytesFromStr(text, text + state->Stb.select_start);
-                    const int utf8_selection_end = callback_data.SelectionEnd = ImTextCountUtf8BytesFromStr(text, text + state->Stb.select_end);
+                    callback_data.CursorPos = state->Stb.cursor;
+                    callback_data.SelectionStart = state->Stb.select_start;
+                    callback_data.SelectionEnd = state->Stb.select_end;
 
                     // Call user code
                     callback(&callback_data);
@@ -742,9 +753,6 @@ bool GameScriptImGuiInputTextEx(void* imgui_context, const char* label, const ch
                     IM_ASSERT(callback_data.Buf == state->TextA.Data);  // Invalid to modify those fields
                     IM_ASSERT(callback_data.BufSize == state->BufCapacityA);
                     IM_ASSERT(callback_data.Flags == flags);
-                    if (callback_data.CursorPos != utf8_cursor_pos)            { state->Stb.cursor = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.CursorPos); state->CursorFollow = true; }
-                    if (callback_data.SelectionStart != utf8_selection_start)  { state->Stb.select_start = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionStart); }
-                    if (callback_data.SelectionEnd != utf8_selection_end)      { state->Stb.select_end = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionEnd); }
                     if (callback_data.BufDirty)
                     {
                         IM_ASSERT(callback_data.BufTextLen == (int)strlen(callback_data.Buf)); // You need to maintain BufTextLen if you change the text!
diff --git a/source_code/main.cpp b/source_code/main.cpp
index 9f6a4d1..4c2f665 100644
--- a/source_code/main.cpp
+++ b/source_code/main.cpp
@@ -38,16 +38,6 @@
 #include "gamescript.cpp"
 #endif
 
-#if defined(GAME_SCRIPT_NATIVE)
-#define GAME_SCRIPT_WINDOW_TITLE "Game Script Native from Dec 22, 2022 (procedural.itch.io/gamescript)"
-#elif defined(GAME_SCRIPT_MIN)
-#define GAME_SCRIPT_WINDOW_TITLE "Game Script Min from Dec 22, 2022 (procedural.itch.io/gamescript)"
-#elif defined(GAME_SCRIPT_C)
-#define GAME_SCRIPT_WINDOW_TITLE "Game Script C from Dec 22, 2022 (procedural.itch.io/gamescript)"
-#else
-#define GAME_SCRIPT_WINDOW_TITLE "Game Script from Dec 22, 2022 (procedural.itch.io/gamescript)"
-#endif
-
 #if defined(_WIN32) && defined(GAME_SCRIPT_NATIVE)
 #define GSN_WIN_EXPORT __declspec(dllexport)
 #else
@@ -183,6 +173,9 @@ GSN_WIN_EXPORT float                                                    gDragAnd
 GSN_WIN_EXPORT std::vector<std::string>                                 gDragAndDropFilepaths;
 GSN_WIN_EXPORT uint64_t                                                 g_codeCurrentLineNumber                                 = 1;
 GSN_WIN_EXPORT int                                                      g_dearImGuiGoToLine                                     = 0;
+GSN_WIN_EXPORT int                                                      g_dearImGuiGoToCharPosition                             = 0;
+GSN_WIN_EXPORT int                                                      g_dearImGuiGoToCharPositionSelectionStart               = 0;
+GSN_WIN_EXPORT int                                                      g_dearImGuiGoToCharPositionSelectionEnd                 = 0;
 #if defined(GAME_SCRIPT_NATIVE)
 GSN_WIN_EXPORT void *                                                   libgame                                                 = 0;
 GSN_WIN_EXPORT void *                                                   libthread2                                              = 0;
@@ -202,6 +195,18 @@ static int  g_previousWindowPosY        = 0;
 static int  g_previousWindowWidth       = 0;
 static int  g_previousWindowHeight      = 0;
 
+#ifdef _WIN32
+static std::string g_currentlyOpenedFile          = "C:\\MainCppIDE\\main.cpp";
+static std::string g_currentlyOpenedFilenameStore = "C:\\MainCppIDE\\maincppide_current_filename.txt";
+static std::string g_autocompleteFilenameCpp      = "C:\\MainCppIDE\\maincppide_autocomplete.cpp";
+static std::string g_autocompleteFilenameScript   = "C:\\MainCppIDE\\maincppide_autocomplete.bat";
+#else
+static std::string g_currentlyOpenedFile          = "main.cpp";
+static std::string g_currentlyOpenedFilenameStore;
+static std::string g_autocompleteFilenameCpp      = "maincppide_autocomplete.cpp";
+static std::string g_autocompleteFilenameScript   = "maincppide_autocomplete.sh";
+#endif
+
 #if defined(GAME_SCRIPT_C)
 void tccMessageCallback(void * opaque, const char * msg) {
   if (msg != 0) {
@@ -355,9 +360,18 @@ static std::vector<float> rayTriangleIntersection(float rayOriginX, float rayOri
   }
 }
 
+static void f1CommandOptionsLoad(std::string filename) {
+  std::string filepath = filename;
+
+  std::ostringstream ss;
+  ss << std::ifstream(filepath).rdbuf();
+  gF1CommandOptions = ss.str();
+
+  gF1CommandOptions.resize(gF1CommandOptions.size() + 1);
+}
+
 static void f1CommandOptionsSave(std::string filename) {
-  std::string filepath = gCurrentExeDir;
-  filepath += filename;
+  std::string filepath = filename;
 
   std::ofstream fs(filepath, std::ofstream::out);
   fs << gF1CommandOptions.c_str();
@@ -365,26 +379,47 @@ static void f1CommandOptionsSave(std::string filename) {
 }
 
 static void scriptSave(std::string filename) {
-  std::string filepath = gCurrentExeDir;
-  filepath += filename;
+  std::string filepath = filename;
 
   std::ofstream fs(filepath, std::ofstream::out);
   fs << gApeCodeChars.c_str();
-  if (gApeCodeChars != "") {
-    if (gApeCodeChars.back() != '\n') {
-      fs << "\n"; // NOTE(Constantine): This is here for a reason: Dear ImGui deletes last character at the beginning of script editing for some reason.
-    }
-  }
   fs.close();
+
+  f1CommandOptionsLoad("build_parameters.txt");
 }
 
 static void scriptLoad(std::string filename) {
-  std::string filepath = gCurrentExeDir;
-  filepath += filename;
+  {
+    std::string name;
+
+    for (size_t i = 0, count = filename.size(); i < count; i += 1) {
+      if (filename[i] == '\\' || filename[i] == '/') {
+        name.clear();
+      } else {
+        name += filename[i];
+      }
+    }
+
+    std::string title;
+    title += name;
+    title += " | ";
+    title += filename;
+    redFSetWindowTitle(title.c_str());
+
+    if (!g_currentlyOpenedFilenameStore.empty()) {
+      std::ofstream fs(g_currentlyOpenedFilenameStore.c_str(), std::ofstream::out);
+      fs << filename.c_str();
+      fs.close();
+    }
+  }
+
+  std::string filepath = filename;
 
   std::ostringstream ss;
   ss << std::ifstream(filepath).rdbuf();
   gApeCodeChars = ss.str();
+
+  gApeCodeChars.resize(gApeCodeChars.size() + 1);
 }
 
 static void apeScriptRerun(RedFBool32 startupRerun) {
@@ -748,7 +783,7 @@ static void apeScriptRerun(RedFBool32 startupRerun) {
 
   }
   if (startupRerun == 0) {
-    scriptSave("autosave.script");
+    scriptSave(g_currentlyOpenedFile);
   }
   free(gApeCodeCharsCurrentlyRunning);
   if (gReadScriptFromDataGameDotScript == 0) {
@@ -927,7 +962,6 @@ static void mape_execute(int threadIndex, void * ape, const char * code) {
 #endif
     std::string source = code;
     fs << source;
-    fs << "\n";
     fs.close();
   }
   profileEnd("save .cpp files");
@@ -993,25 +1027,48 @@ static void mape_execute(int threadIndex, void * ape, const char * code) {
 
 #endif // #if defined(GAME_SCRIPT_NATIVE)
 
+static bool ImGuiIsAnyKeyPressed() {
+  ImGuiIO * io = igGetIO();
+  for (int i = 0; i < 512; i += 1) {
+    if (io->KeysDown[i] == true) {
+      return true;
+    }
+  }
+  return false;
+}
+
+static uint64_t  g_guiCodeEditorPreviousCursorPos = 0;
+static ImWchar * g_guiCodeEditorStbWideChars      = 0;
+
+static void UpdateCurrentLineNumber(uint64_t cursorPos) {
+  g_codeCurrentLineNumber = 1;
+  for (uint64_t i = 0; i < cursorPos; i += 1) {
+    ImWchar c = g_guiCodeEditorStbWideChars[i];
+    if (c == L'\n') {
+      g_codeCurrentLineNumber += 1;
+    }
+  }
+}
+
 static int guiCodeEditorCallback(ImGuiInputTextCallbackData * data) {
+  ImWchar * wchars = (ImWchar *)(void *)data->UserData;
+  g_guiCodeEditorStbWideChars = wchars;
+
   if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) {
     gApeCodeChars.resize(data->BufSize);
     data->Buf = &gApeCodeChars[0];
   }
   // NOTE(Constantine): Compute current line number.
-  {
-    g_codeCurrentLineNumber = 1;
+  if (ImGuiIsAnyKeyPressed() == false) {
     if (gApeCodeChars.size() > 0) {
       uint64_t cursorPos = data->CursorPos;
       if (cursorPos > (gApeCodeChars.size() - 1)) {
         cursorPos = gApeCodeChars.size() - 1;
       }
-      for (uint64_t i = 0; i < cursorPos; i += 1) {
-        char c = gApeCodeChars[i];
-        if (c == '\n') {
-          g_codeCurrentLineNumber += 1;
-        }
+      if (cursorPos != g_guiCodeEditorPreviousCursorPos) { // Recalc the line number then.
+        UpdateCurrentLineNumber(cursorPos);
       }
+      g_guiCodeEditorPreviousCursorPos = cursorPos;
     }
   }
   return 0;
@@ -1041,15 +1098,13 @@ static int guiMemoryViewerIntepretBytesCallback(ImGuiInputTextCallbackData * dat
   return 0;
 }
 
+std::string g_f1FileToRun;
+
 static void threadF1Procedure(void) {
   std::string scriptpath = "\"";
   std::string exedir = gCurrentExeDir;
   scriptpath += exedir;
-#if defined(_WIN32)
-  scriptpath += "f1.bat";
-#else
-  scriptpath += "f1.sh";
-#endif
+  scriptpath += g_f1FileToRun;
   scriptpath += "\"";
   char * output = 0;
   redFSystem(scriptpath.c_str(), &output, 0);
@@ -1731,7 +1786,7 @@ void gsglTexImage2D(unsigned target, int level, int internalformat, int width, i
 
 void RebuildFont(float scale) {
   // NOTE(Constantine): Rebuild Dear ImGui font atlas.
-  const int fontSize = 26 * scale;
+  const int fontSize = 24 * scale;
 
   ImGuiIO * io = igGetIO();
   ImFontAtlas_Clear(io->Fonts);
@@ -1766,10 +1821,239 @@ void RebuildFont(float scale) {
   ImFontAtlas_SetTexID(io->Fonts, (ImTextureID)(uint64_t)fontTextureId);
 }
 
+static int g_saveBuildParametersOnce = 0;
+
+static int guiBuildParametersEditorCallback(ImGuiInputTextCallbackData * data) {
+  if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) {
+    g_saveBuildParametersOnce = 1;
+    gF1CommandOptions.resize(data->BufSize);
+    data->Buf = &gF1CommandOptions[0];
+  }
+  return 0;
+}
+
+static std::string g_CtrlFTextField;
+
+static int guiCtrlFTextFieldCallback(ImGuiInputTextCallbackData * data) {
+  if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) {
+    g_CtrlFTextField.resize(data->BufSize);
+    data->Buf = &g_CtrlFTextField[0];
+  }
+  return 0;
+}
+
+static bool WcharIsAsciiLetterOrNumberOrUnderscore(ImWchar wchar) {
+  if (
+    wchar == L'_' ||
+    wchar == L'a' ||
+    wchar == L'b' ||
+    wchar == L'c' ||
+    wchar == L'd' ||
+    wchar == L'e' ||
+    wchar == L'f' ||
+    wchar == L'g' ||
+    wchar == L'h' ||
+    wchar == L'i' ||
+    wchar == L'j' ||
+    wchar == L'k' ||
+    wchar == L'l' ||
+    wchar == L'm' ||
+    wchar == L'n' ||
+    wchar == L'o' ||
+    wchar == L'p' ||
+    wchar == L'q' ||
+    wchar == L'r' ||
+    wchar == L's' ||
+    wchar == L't' ||
+    wchar == L'u' ||
+    wchar == L'v' ||
+    wchar == L'w' ||
+    wchar == L'x' ||
+    wchar == L'y' ||
+    wchar == L'z' ||
+    wchar == L'A' ||
+    wchar == L'B' ||
+    wchar == L'C' ||
+    wchar == L'D' ||
+    wchar == L'E' ||
+    wchar == L'F' ||
+    wchar == L'G' ||
+    wchar == L'H' ||
+    wchar == L'I' ||
+    wchar == L'J' ||
+    wchar == L'K' ||
+    wchar == L'L' ||
+    wchar == L'M' ||
+    wchar == L'N' ||
+    wchar == L'O' ||
+    wchar == L'P' ||
+    wchar == L'Q' ||
+    wchar == L'R' ||
+    wchar == L'S' ||
+    wchar == L'T' ||
+    wchar == L'U' ||
+    wchar == L'V' ||
+    wchar == L'W' ||
+    wchar == L'X' ||
+    wchar == L'Y' ||
+    wchar == L'Z' ||
+    wchar == L'0' ||
+    wchar == L'1' ||
+    wchar == L'2' ||
+    wchar == L'3' ||
+    wchar == L'4' ||
+    wchar == L'5' ||
+    wchar == L'6' ||
+    wchar == L'7' ||
+    wchar == L'8' ||
+    wchar == L'9'
+  )
+  {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+typedef struct FoundCode {
+  uint64_t selectionStart;
+  uint64_t selectionEnd;
+} FoundCode;
+
+static FoundCode FindCode(std::wstring find, int plusOrMinusOneFindDirection) {
+  uint64_t  cursorPos = g_guiCodeEditorPreviousCursorPos;
+  ImWchar * wchars    = g_guiCodeEditorStbWideChars;
+
+  FoundCode found = {};
+  found.selectionStart = -1;
+  found.selectionEnd   = -1;
+
+  if (wchars == 0) {
+    return found;
+  }
+
+  std::wstring token;
+  for (uint64_t i = cursorPos + (plusOrMinusOneFindDirection == -1 ? -1 : 0); ; i += plusOrMinusOneFindDirection) {
+    ImWchar wchar = 0;
+    if (i != (uint64_t)-1) {
+      //printf("i: %zu\n", i);//DEBUG
+      wchar = wchars[i];
+    } else {
+      i = 0;
+    }
+
+    // NOTE(Constantine): a special case for last the token in the file when searching backwards.
+    if (plusOrMinusOneFindDirection == -1 && (wchar == 0 || wchar == -1)) {
+      i += plusOrMinusOneFindDirection;
+      wchar = wchars[i];
+    }
+    //printf("wchar: %wc\n", wchar);//DEBUG
+
+    if (WcharIsAsciiLetterOrNumberOrUnderscore(wchar) == true) {
+      token += wchar;
+    } else {
+      if (token.size() > 0) {
+        if (plusOrMinusOneFindDirection == -1) {
+          std::reverse(token.begin(), token.end());
+        }
+        //printf("token: %ws, find: %ws\n", token.c_str(), find.c_str());//DEBUG
+        if (token.rfind(find, 0) == 0) { // https://stackoverflow.com/a/40441240
+          //printf("Passed!\n");//DEBUG
+          if (plusOrMinusOneFindDirection == -1) {
+            found.selectionStart = (i + 1);
+            found.selectionEnd   = (i + 1) + find.size();
+            //printf("found.selectionStart: %zu, found.selectionEnd: %zu\n", found.selectionStart, found.selectionEnd);//DEBUG
+          } else {
+            found.selectionStart = (i - token.size());
+            found.selectionEnd   = (i - token.size()) + find.size();
+          }
+          break;
+        }
+        token.clear();
+      }
+    }
+
+    if (wchar == 0 || wchar == -1) {
+      break;
+    }
+  }
+
+  return found;
+}
+
+static void CommandFindCodeNext() {
+  std::wstring find = std::wstring(g_CtrlFTextField.begin(), g_CtrlFTextField.end());
+  // NOTE(Constantine): Resize the find string to the first null terminator (not including it).
+  if (find.size() > 0) {
+    uint64_t newSize = 0;
+    for (size_t i = 0, count = find.size(); i < count; i += 1) {
+      if (find[i] == 0) {
+        break;
+      }
+      newSize += 1;
+    }
+    find.resize(newSize);
+  }
+  if (find.size() == 0) {
+    return;
+  }
+  FoundCode found = FindCode(find, 1);
+  if (found.selectionStart != -1 && found.selectionEnd != -1) {
+    g_guiCodeEditorPreviousCursorPos          = found.selectionEnd;
+    g_dearImGuiGoToCharPosition               = found.selectionEnd;
+    g_dearImGuiGoToCharPositionSelectionStart = found.selectionStart;
+    g_dearImGuiGoToCharPositionSelectionEnd   = found.selectionEnd;
+    UpdateCurrentLineNumber(g_dearImGuiGoToCharPosition);
+  }
+}
+
+static void CommandFindCodePrevious() {
+  std::wstring find = std::wstring(g_CtrlFTextField.begin(), g_CtrlFTextField.end());
+  // NOTE(Constantine): Resize the find string to the first null terminator (not including it).
+  if (find.size() > 0) {
+    uint64_t newSize = 0;
+    for (size_t i = 0, count = find.size(); i < count; i += 1) {
+      if (find[i] == 0) {
+        break;
+      }
+      newSize += 1;
+    }
+    find.resize(newSize);
+  }
+  if (find.size() == 0) {
+    return;
+  }
+  FoundCode found = FindCode(find, -1);
+  if (found.selectionStart != -1 && found.selectionEnd != -1) {
+    g_guiCodeEditorPreviousCursorPos          = found.selectionStart;
+    g_dearImGuiGoToCharPosition               = found.selectionStart;
+    g_dearImGuiGoToCharPositionSelectionStart = found.selectionStart;
+    g_dearImGuiGoToCharPositionSelectionEnd   = found.selectionEnd;
+    UpdateCurrentLineNumber(g_dearImGuiGoToCharPosition);
+  }
+}
+
+static int gCtrlFSetFocusOnInputField = 0;
+static int gCtrlFSetFocusOnCodeEditor = 0;
+
+void windowDragAndDropCallback(GLFWwindow * window, int count, const char ** paths) {
+  if (count <= 0) {
+    return;
+  }
+  scriptSave(g_currentlyOpenedFile);
+  g_currentlyOpenedFile = paths[0];
+  scriptLoad(g_currentlyOpenedFile);
+}
+
 void setup(void) {
   profileBegin("setup");
 
-  gF1CommandOptions.resize(4096);
+  {
+    GLFWwindow * window = (GLFWwindow *)redFGetGLFWwindowPointer();
+    glfwSetDropCallback(window, windowDragAndDropCallback);
+  }
+
+  f1CommandOptionsLoad("build_parameters.txt");
 
   gThreadF1 = redFCreateThread(1);
   if (gThreadF1 != 0) {
@@ -1807,11 +2091,10 @@ void setup(void) {
 
   srand(time(NULL));
   redFDisableArbTex(); // https://forum.openframeworks.cc/t/what-does-ofdisablearbtex-do/26377
-  redFEnableFramebufferSRGBGammaCorrection();
+  //redFEnableFramebufferSRGBGammaCorrection();
   redFEnable(0x884F); // GL_TEXTURE_CUBE_MAP_SEAMLESS, https://www.khronos.org/opengl/wiki/Cubemap_Texture#Seamless_cubemap
   redFClipControl(0x8CA1, 0x935F); // GL_LOWER_LEFT, GL_ZERO_TO_ONE
 
-  redFSetWindowTitle(GAME_SCRIPT_WINDOW_TITLE);
   redFSetEscapeQuitsApp(0);
   redFSetVerticalSync(1);
 
@@ -1820,11 +2103,18 @@ void setup(void) {
   ImGuiIO * io = igGetIO();
   io->FontGlobalScale = 1.0f;
   io->ConfigFlags    |= ImGuiConfigFlags_NavEnableKeyboard;
+  io->BackendFlags   |= ImGuiBackendFlags_HasMouseCursors;
+  io->ConfigWindowsMoveFromTitleBarOnly = true;
+  io->ConfigWindowsResizeFromEdges      = true;
   RebuildFont(gImguiFontGlobalScale);
   ImGuiStyle * style = igGetStyle();
+
+  igStyleColorsDark(style);
+
+#if 0
+
   style->Colors[ImGuiCol_WindowBg].w = 0.99f;
 
-#if defined(GAME_SCRIPT_NATIVE)
   // https://github.com/ocornut/imgui/issues/707#issuecomment-670976818
 
   ImVec4 bgColor;          bgColor.x          = 37/255.f; bgColor.y          = 37/255.f; bgColor.z          = 38/255.f; bgColor.w          = 0.99f;
@@ -1890,6 +2180,8 @@ void setup(void) {
   style->Colors[ImGuiCol_TabUnfocusedActive]   = panelActiveColor;
   style->Colors[ImGuiCol_TabHovered]           = panelHoverColor;
 
+#endif
+
   style->WindowRounding    = 0.0f;
   style->ChildRounding     = 0.0f;
   style->FrameRounding     = 0.0f;
@@ -1897,7 +2189,6 @@ void setup(void) {
   style->PopupRounding     = 0.0f;
   style->ScrollbarRounding = 0.0f;
   style->TabRounding       = 0.0f;
-#endif
 
   gCamera = redFCreateFirstPersonCamera(1);
   redFFirstPersonCameraSetMoveSpeed(gCamera[0], 0.25f);
@@ -1905,7 +2196,12 @@ void setup(void) {
   redFNodeSetGlobalPosition(redFFirstPersonCameraCastToNode(gCamera[0]), 0, 0, 10);
 
   apeScriptRerun(1);
-  scriptLoad("autosave.script");
+  scriptLoad(g_currentlyOpenedFile);
+
+  { // NOTE(Constantine): Focus on the code editor window by default.
+    gCtrlFSetFocusOnCodeEditor = 1;
+    CommandFindCodeNext();
+  }
 
   profileEnd("setup");
 }
@@ -1948,6 +2244,8 @@ void SetBorderlessWindowedFullscreen(int enable) {
   }
 }
 
+static int g_resizeMainCodeWindow = true;
+
 void draw(void) {
   profileBegin("draw");
   std::string thread1FrameString;
@@ -2782,6 +3080,7 @@ void draw(void) {
   if (setRerunTo0 == 1) {
     gRerun = 0;
   }
+  redFBackground(0, 0, 0, 255);
   redFDisableCulling();
   redFColorMask(1, 1, 1, 1);
   redFSetColor(255, 255, 255, 255);
@@ -3244,18 +3543,28 @@ void draw(void) {
         gF1SetNextWindowFocusOnce = 0;
         igSetNextWindowFocus();
       }
-      if (igBegin("F1", (bool *)&gF1WindowIsShownFromNowOn, 0)) {
+      if (igBegin("F5: run build script | Ctrl + Space: autocomplete code after ` character", (bool *)&gF1WindowIsShownFromNowOn, 0)) {
         ImVec2 f1WindowSize = {800, 400};
         igSetWindowSizeVec2(f1WindowSize, ImGuiCond_FirstUseEver);
         if (redFThreadIsRunning(gThreadF1[0]) == 1) {
-#if defined(_WIN32)
-          igText("f1.bat is running...");
-#else
-          igText("f1.sh is running...");
-#endif
+          std::string running;
+          running += g_f1FileToRun;
+          running += " is running...";
+          igText(running.c_str());
           igSeparator();
         }
-        igInputText("f1_options.txt", &gF1CommandOptions[0], 4096, 0, 0, 0);
+
+        if (gCtrlFSetFocusOnInputField == 1) {
+          gCtrlFSetFocusOnInputField = 0;
+          igSetKeyboardFocusHere(0);
+        }
+        igInputText("F3: find ASCII token word", &g_CtrlFTextField[0], g_CtrlFTextField.size(), ImGuiInputTextFlags_CallbackResize, (ImGuiInputTextCallback)guiCtrlFTextFieldCallback, 0);
+
+        igInputText("build_parameters.txt", &gF1CommandOptions[0], gF1CommandOptions.size(), ImGuiInputTextFlags_CallbackResize, (ImGuiInputTextCallback)guiBuildParametersEditorCallback, 0);
+        if (g_saveBuildParametersOnce == 1) {
+          g_saveBuildParametersOnce = 0;
+          f1CommandOptionsSave("build_parameters.txt");
+        }
         ImVec2 inputSize = {};
         inputSize.x = -1;
         inputSize.y = -1;
@@ -3288,11 +3597,30 @@ void draw(void) {
       igEnd();
     }
     static int apeScriptWindowIsOpen = 1;
-    if (igBegin("Game (F3)", (bool *)&apeScriptWindowIsOpen, 0)) {
-      ImVec2 apeWindowSize = {1100, 600};
-      igSetWindowSizeVec2(apeWindowSize, ImGuiCond_FirstUseEver);
+    ImGuiIO * io = igGetIO();
+    ImVec2 v;
+    v.x = 0;
+    v.y = 0;
+    ImGuiCond cond = 0;
+    ImVec2 pivot;
+    pivot.x = 0;
+    pivot.y = 0;
+    static int g_alwaysFitCodeToWindow = 1;
+    if (g_resizeMainCodeWindow == 1 || g_alwaysFitCodeToWindow == 1) {
+      g_resizeMainCodeWindow = 0;
+
+      igSetNextWindowPos(v, cond, pivot);
+      v.x = io->DisplaySize.x;
+      v.y = io->DisplaySize.y;
+      igSetNextWindowSize(v, cond);
+    }
+    if (gCtrlFSetFocusOnCodeEditor == 1) {
+      igSetNextWindowFocus();
+    }
+    if (igBegin("Main Cpp IDE procedural.itch.io/maincppide", NULL, ImGuiWindowFlags_NoCollapse | (g_alwaysFitCodeToWindow == 0 ? 0 : (ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize)))) {
+      gF1WindowIsShownFromNowOn = gF1WindowIsShownFromNowOn == 1 ? !igIsWindowFocused(0) : false;
       ImVec2 buttonSize = {};
-      if (igButton("Rerun (F5)", buttonSize)) {
+      if (false && igButton("Rerun (F5)", buttonSize)) {
         apeScriptRerun(0);
         if (gStopScript == 1) {
           gRunScriptOnce = 2;
@@ -3301,10 +3629,11 @@ void draw(void) {
           gCurrentFrame -= 1; // NOTE(Constantine): Workaround, since the next gCurrentFrame += 1 must set it to 0.
         }
       }
-      igSameLine(0, 14);
-      igCheckbox("Run from game.script", (bool *)&gReadScriptFromDataGameDotScript);
-      igSameLine(0, 14);
-      igText("| Current frame: %lu", gCurrentFrame == (uint64_t)-1 ? 0 : gCurrentFrame);
+      igText("Current line: %llu | ", g_codeCurrentLineNumber);
+      igSameLine(0, 0);
+      igCheckbox("Fit code to window", (bool *)&g_alwaysFitCodeToWindow);
+      igSameLine(0, 15);
+      igText("| Current frame: %lu | F1: toggle console | F4: fit code to window | F5: build", gCurrentFrame == (uint64_t)-1 ? 0 : gCurrentFrame);
       {
         if (gApeErrorCheck >= 1) {
           if (gApeErrorCheck == 1) {
@@ -3339,7 +3668,11 @@ void draw(void) {
         ImVec2 inputSize = {};
         inputSize.x = -1;
         inputSize.y = -1;
-        GameScriptImGuiInputTextMultiline((void *)igGetCurrentContext(), " Script", &gApeCodeChars[0], gApeCodeChars.size(), &inputSize, ImGuiInputTextFlags_AllowTabInput | ImGuiInputTextFlags_CallbackResize | ImGuiInputTextFlags_CallbackAlways, (void *)guiCodeEditorCallback, 0);
+        GameScriptImGuiInputTextMultiline((void *)igGetCurrentContext(), g_currentlyOpenedFile.c_str(), &gApeCodeChars[0], gApeCodeChars.size(), &inputSize, ImGuiInputTextFlags_AllowTabInput | ImGuiInputTextFlags_CallbackResize | ImGuiInputTextFlags_CallbackAlways, (void *)guiCodeEditorCallback, 0);
+      }
+      if (gCtrlFSetFocusOnCodeEditor == 1) {
+        gCtrlFSetFocusOnCodeEditor = 0;
+        igSetKeyboardFocusHere(-1);
       }
     }
     igEnd();
@@ -3350,7 +3683,7 @@ void draw(void) {
     static int apeMemoryViewerWindowBytesRangeLimitFirst    = 0;
     static int apeMemoryViewerWindowBytesRangeLimitCount    = 8;
     static int apeMemoryViewerWindowBytesPerRow             = 8;
-    if (igBegin("Memory viewer", (bool *)&apeMemoryViewerWindowIsOpen, 0)) {
+    if (false && igBegin("Memory viewer", (bool *)&apeMemoryViewerWindowIsOpen, 0)) {
       {
         ImVec2 pos  = {};
         ImVec2 size = {};
@@ -3713,7 +4046,7 @@ void draw(void) {
         }
       }
     }
-    igEnd();
+    //igEnd();
     redFImguiEnd(gGuiImgui[0]);
     redFPopStyle();
   }
@@ -3790,30 +4123,54 @@ static void keyPressed(RedFHandleEventParametersKey parameters) {
     g_windowIsHoldingCtrlKey = true;
   }
 
-  if (gDisableDefaultFkeys == 0) {
-    if (keycode == GLFW_KEY_F1) {
+  {
+    if (keycode == GLFW_KEY_F5) { // build
       gF1SetNextWindowFocusOnce = 1;
       if (gF1WindowIsShownFromNowOn == 0) {
         gF1WindowIsShownFromNowOn = 1;
       } else {
+        scriptSave(g_currentlyOpenedFile);
         if (redFThreadIsRunning(gThreadF1[0]) == 0) {
-          scriptSave("f1.script");
-          f1CommandOptionsSave("f1_options.txt");
+          #if defined(_WIN32)
+          g_f1FileToRun = "build.bat";
+          #else
+          g_f1FileToRun = "build.sh";
+          #endif
           redFThreadStart(gThreadF1[0]);
         }
       }
-    } else if (keycode == GLFW_KEY_F2) {
-      gF2Toggle = gF2Toggle == 1 ? 0 : 1;
-    } else if (keycode == GLFW_KEY_F3) {
-      gGameMode = gGameMode == 1 ? 0 : 1;
-    } else if (keycode == GLFW_KEY_F5) {
+    } else if (keycode == GLFW_KEY_F1) { // toggle console
+      gF1WindowIsShownFromNowOn = !gF1WindowIsShownFromNowOn;
+    } else if (g_windowIsHoldingCtrlKey && gGlfwKeyEvent[GLFW_KEY_S]) { // save
+      scriptSave(g_currentlyOpenedFile);
+    } else if (g_windowIsHoldingCtrlKey && gGlfwKeyEvent[GLFW_KEY_F]) { // find window
+      gF1WindowIsShownFromNowOn  = 1;
+      gCtrlFSetFocusOnInputField = 1;
+    } else if (keycode == GLFW_KEY_F2) { // find previous
+      gCtrlFSetFocusOnCodeEditor = 1;
+      CommandFindCodePrevious();
+    } else if (keycode == GLFW_KEY_F3) { // find next
+      gCtrlFSetFocusOnCodeEditor = 1;
+      CommandFindCodeNext();
+    } else if (g_windowIsHoldingCtrlKey && gGlfwKeyEvent[GLFW_KEY_SPACE]) { // autocomplete
+      gF1WindowIsShownFromNowOn = 1;
+      {
+        scriptSave(g_autocompleteFilenameCpp);
+        if (redFThreadIsRunning(gThreadF1[0]) == 0) {
+          g_f1FileToRun = g_autocompleteFilenameScript;
+          redFThreadStart(gThreadF1[0]);
+        }
+      }
+    } else if (keycode == GLFW_KEY_F4) { // fit code to window
+      g_resizeMainCodeWindow = 1;
+    } else if (false && keycode == GLFW_KEY_F5) {
       apeScriptRerun(0);
       if (gStopScript == 1) {
         gRunScriptOnce = 2;
       }
-    } else if (keycode == GLFW_KEY_F7) {
+    } else if (false && keycode == GLFW_KEY_F7) {
       gStopScript = 1;
-    } else if (keycode == GLFW_KEY_F9) {
+    } else if (false && keycode == GLFW_KEY_F9) {
       gStopScript = 0;
     } else if (keycode == GLFW_KEY_F11) {
       gFullscreen = gFullscreen == 0 ? 1 : 0;
@@ -3891,42 +4248,98 @@ static void dragged(RedFHandleEventParametersDrag parameters) {
   gDragAndDropCounter += 1;
 }
 
+#ifdef _WIN32
+// https://devblogs.microsoft.com/pix/taking-a-capture/
+
+#pragma comment(lib, "Shell32") // For SHGetKnownFolderPath
+
+static std::wstring GetLatestWinPixGpuCapturerPath()
+{
+    LPWSTR programFilesPath = nullptr;
+    SHGetKnownFolderPath(FOLDERID_ProgramFiles, KF_FLAG_DEFAULT, NULL, &programFilesPath);
+
+    std::wstring pixSearchPath = programFilesPath + std::wstring(L"\\Microsoft PIX\\*");
+
+    WIN32_FIND_DATAW findData;
+    bool foundPixInstallation = false;
+    wchar_t newestVersionFound[MAX_PATH];
+
+    HANDLE hFind = FindFirstFileW(pixSearchPath.c_str(), &findData);
+    if (hFind != INVALID_HANDLE_VALUE)
+    {
+        do
+        {
+            if (((findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) &&
+                 (findData.cFileName[0] != '.'))
+            {
+                if (!foundPixInstallation || wcscmp(newestVersionFound, findData.cFileName) <= 0)
+                {
+                    foundPixInstallation = true;
+                    StringCchCopyW(newestVersionFound, _countof(newestVersionFound), findData.cFileName);
+                }
+            }
+        }
+        while (FindNextFileW(hFind, &findData) != 0);
+    }
+
+    FindClose(hFind);
+
+    std::wstring out;
+
+    if (!foundPixInstallation)
+    {
+        // TODO: Error, no PIX installation found
+        return out;
+    }
+
+    wchar_t output[MAX_PATH];
+    StringCchCopyW(output, pixSearchPath.length(), pixSearchPath.data());
+    StringCchCatW(output, MAX_PATH, &newestVersionFound[0]);
+    StringCchCatW(output, MAX_PATH, L"\\WinPixGpuCapturer.dll");
+
+    out = output;
+
+    return out;
+}
+#endif
+
 int main(int argumentsCount, const char ** arguments) {
 #ifdef __linux__
   redFGetCurrentExeDir(&gCurrentExeDir, 0);
 #else
   gCurrentExeDir = (char *)calloc(1, 1);
 #endif
-  int width       = 1800;
-  int height      = 900;
-  int useOpenGL32 = 1;
+  int width       = 1100;
+  int height      = 800;
+  int useOpenGL32 = 0;
+  int showConsole = 1;
   for (int i = 0; i < argumentsCount; i += 1) {
     std::string arg = std::string(arguments[i]);
     gProgramArguments.push_back(arg);
     if (i > 0) {
       if (arg == "--help") {
         printf("OPTIONS:"                                "\n");
-        printf("  --game-mode"                           "\n");
         printf("  --fullscreen"                          "\n");
         printf("  --fullscreen-exclusive"                "\n");
         printf("  --width <value>"                       "\n");
         printf("  --height <value>"                      "\n");
         printf("  --set-imgui-font-global-scale <value>" "\n");
-        printf("  --disable-default-fkeys"               "\n");
         printf("  --disable-window-decorations"          "\n");
-        printf("  --enable-opengl21"                     "\n");
-        printf("  --disable-embree-procedures"           "\n");
-        printf("  --disable-redgpu-procedures"           "\n");
-        printf("  --disable-xatlas-procedures"           "\n");
-        printf("  --disable-fbx-procedures"              "\n");
-        printf("  --set-directory-path <value>"          "\n");
-#if defined(GAME_SCRIPT_NATIVE)
-        printf("  --load-game-library-at-start"          "\n");
-        printf("  --load-thread2-library-at-start"       "\n");
-#endif
+        printf("  --enable-opengl32"                     "\n");
+        printf("  --pix-on-windows"                      "\n");
+        printf("  --hide-console"                        "\n");
         fflush(stdout);
         exit(0);
-      } else if (arg == "--game-mode") {
+      } else if (arg == "--pix-on-windows") {
+        #ifdef _WIN32
+        std::wstring pixDllPath = GetLatestWinPixGpuCapturerPath();
+        if (pixDllPath.empty() == false) {
+          LoadLibraryW(pixDllPath.c_str());
+        }
+        #endif
+      } else if (arg == "--hide-console") {
+        showConsole = 0;
+      } else if (false && arg == "--game-mode") {
         gGameMode = 1;
         scriptLoad("game.script");
       } else if (arg == "--fullscreen") {
@@ -3948,21 +4361,21 @@ int main(int argumentsCount, const char ** arguments) {
           std::string nextArg = std::string(arguments[i + 1]);
           gImguiFontGlobalScale = std::stof(nextArg);
         }
-      } else if (arg == "--disable-default-fkeys") {
+      } else if (false && arg == "--disable-default-fkeys") {
         gDisableDefaultFkeys = 1;
       } else if (arg == "--disable-window-decorations") {
         g_windowIsDecorated = 0;
-      } else if (arg == "--enable-opengl21") {
-        useOpenGL32 = 0;
-      } else if (arg == "--disable-embree-procedures") {
+      } else if (arg == "--enable-opengl32") {
+        useOpenGL32 = 1;
+      } else if (false && arg == "--disable-embree-procedures") {
         gEmbreeIsEnabled = 0;
-      } else if (arg == "--disable-redgpu-procedures") {
+      } else if (false && arg == "--disable-redgpu-procedures") {
         gRedGpuIsEnabled = 0;
-      } else if (arg == "--disable-xatlas-procedures") {
+      } else if (false && arg == "--disable-xatlas-procedures") {
         gXatlasIsEnabled = 0;
-      } else if (arg == "--disable-fbx-procedures") {
+      } else if (false && arg == "--disable-fbx-procedures") {
         gFbxIsEnabled = 0;
-      } else if (arg == "--set-directory-path") {
+      } else if (false && arg == "--set-directory-path") {
         if (i + 1 < argumentsCount) {
 #if defined(_WIN32)
           gCurrentExeDir = _strdup(arguments[i + 1]);
@@ -3971,7 +4384,7 @@ int main(int argumentsCount, const char ** arguments) {
 #endif
         }
 #if defined(GAME_SCRIPT_NATIVE)
-      } else if (arg == "--load-game-library-at-start") {
+      } else if (false && arg == "--load-game-library-at-start") {
         std::string dir = gCurrentExeDir;
 
 #if defined(__linux__)
@@ -3982,7 +4395,7 @@ int main(int argumentsCount, const char ** arguments) {
 #error Error
 #endif
 
-      } else if (arg == "--load-thread2-library-at-start") {
+      } else if (false && arg == "--load-thread2-library-at-start") {
         std::string dir = gCurrentExeDir;
 
 #if defined(__linux__)
@@ -3997,6 +4410,23 @@ int main(int argumentsCount, const char ** arguments) {
       }
     }
   }
+  if (showConsole == 0) {
+    #ifdef _WIN32
+    FreeConsole();//DEBUG
+    #endif
+  }
+  if (argumentsCount >= 2) {
+    std::string lastArgument = arguments[argumentsCount - 1];
+    if (lastArgument.size() >= 2) {
+      if (lastArgument[0] != '-' && lastArgument[1] != '-') {
+        g_currentlyOpenedFile = lastArgument;
+      }
+    } else if (lastArgument.size() == 1) {
+      if (lastArgument[0] != '-') {
+        g_currentlyOpenedFile = lastArgument;
+      }
+    }
+  }
   RedFEvents events = {};
   events.setup         = setup;
   events.update        = update;
@@ -4013,7 +4443,7 @@ int main(int argumentsCount, const char ** arguments) {
   events.mouseExited   = mouseExited;
   events.dragged       = dragged;
   redFMain(&events, width, height, gFullscreenExclusive == 1 ? REDF_WINDOW_MODE_GAME_MODE : REDF_WINDOW_MODE_WINDOW, useOpenGL32, g_windowIsDecorated, 1, MSAA_SAMPLES_COUNT, 0, 0);
-  scriptSave("autosave.script");
+  scriptSave(g_currentlyOpenedFile);
 }
 
 #if defined(GAME_SCRIPT_NATIVE)
